#ifndef ITEMFACTORY_H
#define ITEMFACTORY_H

#pragma warning( disable : 4290 )

class Item;

class itemfactory_error : public std::logic_error 
{
public:
	itemfactory_error(const std::string &error) : logic_error(error) { }
};

class ItemFactory{
public:
	ItemFactory();
	~ItemFactory();

	// Create a new item blueprint
	void create(std::string id) throw(itemfactory_error);
	// Load a blueprint
	void load(std::string id);
	// Methods to make changes to the loaded blueprint
	void setId(std::string newid);
	void setName(std::string name);
	void setDescription(std::string desc);
	void setPicName(std::string picname);
	// Save changes made to blueprint
	void save();
	void delItem() throw(itemfactory_error);
	
	// Creates an item object from a blueprint and returns it
	Item* build(std::string id) throw(itemfactory_error);
protected:

	Item* item_;

};

#endif
